<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="../Include/Conn.asp" -->
<!--#include file="seeion.asp"-->
<!--#include file="page.asp" -->
<%call chkAdmin("|3")%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" id="css" href="images/style.css">
<title>后台登陆记录</title>
<script language="javascript"> 
<!-- 
function CheckAll(){ 
 for (var i=0;i<eval(form1.elements.length);i++){ 
  var e=form1.elements[i]; 
  if (e.name!="allbox") e.checked=form1.allbox.checked; 
 } 
} 
--> 
</script> 
</head>
<body>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
  <tr>
    <td height="30" class="topnav"><div>后台登陆记录</div></td>
  </tr>
  <tr>
    <td bgcolor="#FFFFFF">
    <table width="100%" border="0" align="center" cellpadding="0" cellspacing="1">
      <tr>
        <td colspan="11" bgcolor="#FFFFFF">
         <form id="form1" name="form1" method="post" action="admin_count.asp?del=checkbox"> 
<table width="100%" border="0" cellpadding="5" cellspacing="0" class="stable">
		<tr>
              <td width="33" align="center" class="td">选中</td>
              <td width="49" align="center" class="td">序号</td>
              <td width="169" height="25" align="center" class="td">用户名</td>
              <td width="115" align="center" class="td">登陆IP</td>
              <td class="td">来源地址</td>
              <td width="134" align="center" class="td">登陆时间</td>
            </tr>
<%	
set rs=server.createobject("adodb.recordset") 
exec="select * from [admincount] order by id desc" 
rs.open exec,conn,1,1 
if rs.eof then
response.write ("暂无记录...")
else
rs.PageSize =20 '每页记录条数
iCount=rs.RecordCount '记录总数
iPageSize=rs.PageSize
maxpage=rs.PageCount 
page=request("page")
if Not IsNumeric(page) or page="" then
page=1
else
page=cint(page)
end if
if page<1 then
page=1
elseif  page>maxpage then
page=maxpage
end if
rs.AbsolutePage=Page
if page=maxpage then
x=iCount-(maxpage-1)*iPageSize
else
x=iPageSize
end if	 
for i=1 to rs.pagesize 
j=i 
if j mod 2=0 then 
bg="#F1F5F8" 
else 
bg="#FFFFFF" 
end if %>        
            <tr>
              <td align="center" class="td"><input name="ID" type="checkbox" id="ID" value="<%=rs("id")%>" /></td>
              <td align="center" class="td"><input type="text" class="inp" style="text-align:center;width:40px" value="<%=i%>" readonly="readonly"/></td>
              <td height="25" align="center" class="td"><%=rs("name")%> </td>
              <td align="center" class="td"><%=rs("ip")%></td>
              <td class="td"><% If rs("dz")<>"" Then %><%=rs("dz")%><% Else %>

			  <script charset="gb2312" src="http://<%=zurl%>/Include/IP/ip.asp?action=c&ip=<%=rs("ip")%>"></script><% End If %>

              </td>
              <td align="center" class="td"><%=rs("dldata")%></td>
            </tr>
<% rs.movenext 
if rs.eof then exit for 
next 
end if%> 
		<tr onmouseover="style.backgroundColor='#EEEEEE'" onmouseout="style.backgroundColor='<%=bg%>'" bgcolor="<%=bg%>">
        <td width="33" height="30" align="center" style="padding-left:5px"> <input type="checkbox" name="allbox" onclick="CheckAll()" /></td>
        <td width="49"><span style="padding-left:5px">全选</span></td>
        <td colspan="4"><input type="submit" name="button" id="button" value="删除选中项"  class="btn"/>
          <%call PageControl(iCount,maxpage,page)
rs.close
set rs=nothing
%></td>
                
</table>
</form> 
</td>
      </tr>
    </table></td>
  </tr>
</table>
</body>
</html>
<%
if Request.QueryString("del")="checkbox" then
if Request("id")="" then
Response.Write "<script>alert('请选择要删除的记录!');window.location.href='admin_count.asp';</script>" 
response.end()
end if
dim sql
sql="delete from admincount where id in ("&Request("id")&")"
conn.Execute ( sql )
conn.close
set conn=nothing
Response.Write "<script>alert('批量删除成功!');window.location.href='admin_count.asp';</script>" 
end if
%>
